package com.tencent.welink.api.space.alarm;

import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * @Description: 4.根据告警类型状态起始时间统计告警信息
 * @Author: limye
 * @CreateDate: 2020-6-16
 * @Version: V1.0
 */
public class GetStatisticsData extends WelinkOpenApi {

    private static final Logger log = LogManager.getLogger(GetStatisticsData.class);

    public GetStatisticsData(){
        super("/space/datahub/alarm/v0.1/getStatisticsData",true);
    }


    @Override
    public void displayResult(String result) {
    }


    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes,true);

        //实例化对象
        GetStatisticsData instance = new GetStatisticsData();

        /**
         * 参数名	参数类型	说明	是否必填
         * type	String	告警类型	否
         * status	String	状态 processed unprocessed processing	否
         * beginTime	String	开始时间yyyyMMddHHmmss	否
         * endTime	String	结束时间yyyyMMddHHmmss	否
         * appIds	String	告警上报的appid，英文,分隔	否
         * token	String	鉴权token	是
         * isAll	Boolean	是否统计全量告警数据（包括收敛的告警）默认false	否
         */
        //添加参数
        Map<String,Object> map = instance.getExtendsPara();

        //执行HTTP请求及展示结果
        instance.DoHttp();
        CrontabUtil.shutdown();

    }
}
